package test00.tx06;

import test00.tx05.Student;

import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;

public class MainTest {
    public static void main(String[] args) {
        Student[] students = {
                new Student("Zing", 20),
                new Student("Ying", 22),
                new Student(null, 17),
                new Student("Qing", 19),
                // 可继续添加更多学生
        };
        for (Student student : students) {
            Optional<String> optional = Optional.ofNullable(student.name);
            System.out.println(optional
                    .map(String::toLowerCase)
                    .orElse("匿名"));
        }
    }
}
